package my.mall.db.entity

import com.baomidou.mybatisplus.annotation.IdType
import com.baomidou.mybatisplus.annotation.TableId
import com.baomidou.mybatisplus.annotation.TableName
import java.time.LocalDateTime

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author fengbo
 * @since 2024-04-22
 */
@TableName("mall_user")
class User {

    /**
     * 用户主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    var id: Long? = null

    /**
     * 数据更新时间
     */
    var updatedTime: LocalDateTime? = null

    /**
     * 数据新建时间
     */
    var createdTime: LocalDateTime? = null

    /**
     * 用户昵称或网络名称
     */
    var nickname: String? = null

    /**
     * 用户手机号码
     */
    var phoneNum: Long? = null

    /**
     * 0 可用, 1 冻结
     */
    var userStatus: Byte? = null

    /**
     * 用户密码
     */
    var userPassword: String? = null

    /**
     * 用户积分
     */
    var rewardPoint: Int? = null

    /**
     * 验证码
     */
    var smsCode: Int? = null

    /**
     * 验证码发送时间
     */
    var smsTime: LocalDateTime? = null

    companion object {

        const val ID : String = "id"


        const val UPDATED_TIME : String = "updated_time"


        const val CREATED_TIME : String = "created_time"


        const val NICKNAME : String = "nickname"


        const val PHONE_NUM : String = "phone_num"


        const val USER_STATUS : String = "user_status"


        const val USER_PASSWORD : String = "user_password"


        const val REWARD_POINT : String = "reward_point"


        const val SMS_CODE : String = "sms_code"


        const val SMS_TIME : String = "sms_time"

    }

    override fun toString(): String {
        return "User{" +
        "id=" + id +
        ", updatedTime=" + updatedTime +
        ", createdTime=" + createdTime +
        ", nickname=" + nickname +
        ", phoneNum=" + phoneNum +
        ", userStatus=" + userStatus +
        ", userPassword=" + userPassword +
        ", rewardPoint=" + rewardPoint +
        ", smsCode=" + smsCode +
        ", smsTime=" + smsTime +
        "}"
    }
}
